package com.ruoyi.project.zerocarbon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zerocarbon.mapper.DeclareMediaCoverageMapper;
import com.ruoyi.project.zerocarbon.domain.DeclareMediaCoverage;
import com.ruoyi.project.zerocarbon.service.IDeclareMediaCoverageService;

/**
 * 媒体报道情况Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class DeclareMediaCoverageServiceImpl implements IDeclareMediaCoverageService 
{
    @Autowired
    private DeclareMediaCoverageMapper declareMediaCoverageMapper;

    /**
     * 查询媒体报道情况
     * 
     * @param id 媒体报道情况ID
     * @return 媒体报道情况
     */
    @Override
    public DeclareMediaCoverage selectDeclareMediaCoverageById(Long id)
    {
        return declareMediaCoverageMapper.selectDeclareMediaCoverageById(id);
    }

    /**
     * 查询媒体报道情况列表
     * 
     * @param declareMediaCoverage 媒体报道情况
     * @return 媒体报道情况
     */
    @Override
    public List<DeclareMediaCoverage> selectDeclareMediaCoverageList(DeclareMediaCoverage declareMediaCoverage)
    {
        return declareMediaCoverageMapper.selectDeclareMediaCoverageList(declareMediaCoverage);
    }

    /**
     * 新增媒体报道情况
     * 
     * @param declareMediaCoverage 媒体报道情况
     * @return 结果
     */
    @Override
    public int insertDeclareMediaCoverage(DeclareMediaCoverage declareMediaCoverage)
    {
        declareMediaCoverage.setCreateTime(DateUtils.getNowDate());
        return declareMediaCoverageMapper.insertDeclareMediaCoverage(declareMediaCoverage);
    }

    /**
     * 修改媒体报道情况
     * 
     * @param declareMediaCoverage 媒体报道情况
     * @return 结果
     */
    @Override
    public int updateDeclareMediaCoverage(DeclareMediaCoverage declareMediaCoverage)
    {
        declareMediaCoverage.setUpdateTime(DateUtils.getNowDate());
        return declareMediaCoverageMapper.updateDeclareMediaCoverage(declareMediaCoverage);
    }

    /**
     * 批量删除媒体报道情况
     * 
     * @param ids 需要删除的媒体报道情况ID
     * @return 结果
     */
    @Override
    public int deleteDeclareMediaCoverageByIds(Long[] ids)
    {
        return declareMediaCoverageMapper.deleteDeclareMediaCoverageByIds(ids);
    }

    /**
     * 删除媒体报道情况信息
     * 
     * @param id 媒体报道情况ID
     * @return 结果
     */
    @Override
    public int deleteDeclareMediaCoverageById(Long id)
    {
        return declareMediaCoverageMapper.deleteDeclareMediaCoverageById(id);
    }
}
